﻿{#if $T.d.length == 0}
<div class="info">
    {#if window.location.href.indexOf('Spam.aspx') > 0}
    {BlogAdmin.i18n.noSpamHere}
    {#/if}
    {#if window.location.href.indexOf('Pending.aspx') > 0}
    {BlogAdmin.i18n.noPendingComments}
    {#/if}
    {#if window.location.href.indexOf('Approved.aspx') > 0}
    {BlogAdmin.i18n.noApprovedComments}
    {#/if}
    {#if window.location.href.indexOf('Pingbacks.aspx') > 0}
    {BlogAdmin.i18n.noPingbacksTrackbacks}
    {#/if}
</div>
{#else}
<table id="Comments" class="beTable rounded" style="width:100%">
    <thead>
        <tr>
	        <th width="20"><input type="checkbox" id="selectall" onclick="toggleAllChecks(this)" /></th>
            <th width="38">&nbsp;</th>
            <th width="auto">{BlogAdmin.i18n.comment}</th>
	        <th width="120">{BlogAdmin.i18n.ip}</th>
	        <th width="100">{BlogAdmin.i18n.createdOn}</th>
            <th width="70">&nbsp;</th>
        </tr>
    </thead>
    <tbody>
        {#foreach $T.d as cmt}
        <tr id="{$T.cmt.Id}" class="{#cycle values=['','alt']}">
            <td><input type="checkbox" {#if $T.cmt.HasChildren} disabled {#/if} class="chk"/></td>
            <td>{$T.cmt.Avatar}</td>
            <td><span class="commenttitle">{$T.cmt.Title}</span>
                {$T.cmt.Teaser}</td>
            <td>{$T.cmt.Ip}</td>
            <td><span class="comment_date">{$T.cmt.Date}</span><span class="comment_time">{$T.cmt.Time}</span></td>
            <td>
                <ul class="rowTools">
                    <li>
                        <a class="toolsAction" href="#"><span class="">{BlogAdmin.i18n.tools}</span></a>
                        <ul class="rowToolsMenu">
                            <li><a class="editAction" href="#" onclick="return EditComment('{$T.cmt.Id}');">{BlogAdmin.i18n.edit}</a></li>
                            {#if window.location.href.indexOf('Spam.aspx') > 0 || window.location.href.indexOf('Pending.aspx') > 0}
                            <li><a class="approveAction" href="#" onclick="return CommentAction('Approve','{$T.cmt.Id}');">{BlogAdmin.i18n.approve}</a></li>
                            {#/if}
                            {#if window.location.href.indexOf('Approved.aspx') > 0 && $T.cmt.HasChildren == false}
                            <li><a class="unapproveAction" href="#" onclick="return CommentAction('Reject','{$T.cmt.Id}');">{BlogAdmin.i18n.unapprove}</a></li>
                            {#/if}
                            {#if $T.cmt.HasChildren == false}
                            <li><a href="#" class="deleteAction" onclick="return CommentAction('Delete','{$T.cmt.Id}');">{BlogAdmin.i18n.delete}</a></li>
                            {#/if}
                       </ul>
                    </li>
               </ul>
            </td>
        </tr>
        {#/for}
    </tbody>
</table>
{#/if}

{#if $T.d.length > 0}
    {#if window.location.href.indexOf('Spam.aspx') > 0}
    <div class="action_buttons">
        <input type="submit" class="btn" value="{BlogAdmin.i18n.restoreSelected}" onclick="return ProcessSelected('Approve','Spam');" />&nbsp;
		<input type="submit" class="btn" value="{BlogAdmin.i18n.deleteSelected}" onclick="return ProcessSelected('Delete', 'Spam');" />&nbsp;
        <input type="submit" class="btn" value="{BlogAdmin.i18n.deleteAll}" onclick="return DeleteAllSpam();" />&nbsp;
        <span class="loader">&nbsp;</span>
    </div>
    {#/if}
    {#if window.location.href.indexOf('Pending.aspx') > 0}
    <div class="action_buttons">
		<input type="submit" class="btn" value="{BlogAdmin.i18n.approveSelected}" onclick="return ProcessSelected('Approve', 'Pending');" />&nbsp;
        <input type="submit" class="btn" value="{BlogAdmin.i18n.rejectSelected}" onclick="return ProcessSelected('Reject', 'Pending');" />&nbsp;
        <input type="submit" id="btn-delete" class="btn" value="{BlogAdmin.i18n.deleteSelected}" onclick="return ProcessSelected('Delete', 'Pending');" />&nbsp;
        <span class="loader">&nbsp;</span>
    </div>
    {#/if}
    {#if window.location.href.indexOf('Approved.aspx') > 0}
    <div class="action_buttons">
        <input type="submit" class="btn" value="{BlogAdmin.i18n.rejectSelected}" onclick="return ProcessSelected('Reject', 'Approved');" />&nbsp;
        <input type="submit" class="btn" value="{BlogAdmin.i18n.deleteSelected}" onclick="return ProcessSelected('Delete', 'Approved');" />&nbsp;
        <span class="loader">&nbsp;</span>
    </div>
    {#/if}
    {#if window.location.href.indexOf('Pingbacks.aspx') > 0}
    <div class="action_buttons">
		<input type="submit" class="btnAddNew btn" value="{BlogAdmin.i18n.deleteSelected}" onclick="return ProcessSelected('Delete', 'Pingback');" />&nbsp;
        <span class="loader">&nbsp;</span>
    </div>
    {#/if}
{#/if}

<script type="text/javascript">
    $('.loader').hide();
</script>
